package org.aspectsense.middleware.helpers;
import java.awt.Dimension;
import java.awt.Font;

import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.UIManager;

public class PromptMessage {


	private  JTextArea textArea = new JTextArea();
	
	public  PromptMessage (){
		;
	}

	public void drawDialog(String msg) {
	
		setLookAndFeel();
		textArea.setFont(new Font("Sans-Serif", Font.PLAIN, 14));
		textArea.setEditable(false);
		textArea.setText(msg);
		
		// stuff it in a scrollpane with a controlled size.
		JScrollPane scrollPane = new JScrollPane(textArea);		
		scrollPane.setPreferredSize(new Dimension(700, 550));

		// pass the scrollpane to the joptionpane.				
		JOptionPane.showMessageDialog(null, scrollPane, "AspectSence Information Panel", JOptionPane.INFORMATION_MESSAGE);
		
	}
	private static void setLookAndFeel() 
	{
		try 
		{
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}
		catch(Exception e) 
		{
			e.printStackTrace();
		}
	}
		
	 


}
